<?php

namespace App\Console\Commands;

use App\Lib\ModelSdk;
use Illuminate\Console\Command;
use GuzzleHttp\Client;

class TestCmd extends Command
{

    const ISO8601_BASIC = 'Ymd\THis\Z';

    public $signature = 'test:test';

    public function handle()
    {
//        $resFile = file_get_contents(public_path("tag.txt"));
//        $resArr = explode("\n", $resFile);
//
//        foreach ($resArr as $item) {
//            $itemArr = explode("\t", $item);
//            $data = [
//                "name" => $itemArr[2],
//                "platform_id" => $itemArr[0],
//                "parent_id" => 632
//            ];
//            (new JingdongTagCategoryDep())->add($data);
//       }
//
//         $service = new XiaoHongSdk();
//         $res = $service->getSign();
//
//         dd($res);

//        $service = new SdSdk();
//        $arr = [
//            '0001','0002','0003'
//        ];
//        foreach ($arr as $path){
//            $this->info($path);
//            $res = $service->test($path);
//            $this->info(json_encode($res));
//        }

//        $service = new XiaoHongSdk('access-token-creator.xiaohongshu.com=customer.ares.AT-0b9f2cb302f74a159a19c7599c08e932-18577c754dc34223af34975a4d5fba58');
//        $res = $service->getTopicList();
//        dd($res);

//        $c = new TopClient('34630419','2c68d0732eace5112591be109431119d');
//        $c->format = 'json';
//        $req = new GuangguangContentBrandSearchRequest();
//        $req->setKeyword('耐克');
//        $req->setSize(1);
//        $req->setCursor(1);
//
//        $res = $c->execute($req,'6101a179615f43af7db32f886141d7692f7381ba70c18c41832241948');
//        dd($res);


//        $service = new Top('610172990c65fa59367f8b2736e16c008554b1bef1848923087481805');
//        $res =  $service->uploadContent('http://fu.maixiaotu.com:1010/17050477863438570752.jpg,http://fu.maixiaotu.com:1010/17050477863438570752.jpg');
//        dd($res);

//        $res = $service->searchBrand('耐克',1,1);
//        dd($res);
//        $file = file_get_contents('https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2024%2F0212%2Ff8a91614j00s8qvyv0026d200u000u0g007w007w.jpg&thumbnail=660x2147483647&quality=80&type=jpg');
//        $res= $service->uploadImage('image/jpg',$file,);
//        dd($res);
//        $res = $service->topicGroup();
//        dd($res);
//        $res = $service->releasePicture();
//        $res = $service->releaseVideo();
//        $res = $service->delContent(451917783545);
//        dd($res);

//        $res = $service->getSource();
//        dd($res);

//         $res = $service->topicGroup();
//        dd($res);

//        $service = new JdWebSdk('thor=25D38DE8EE0BEC220BD3DE11D8390FF665BBF66DF725F3DB6B00947AFD9E97D8E704B246DE374BEFBFE562FC61A3D99D4F5792A4FE8DB28F0BBDBE89C7B5DBA3833D54F3CAE58E44E089054CA7C58D583571B30630AE13A67BB7A8FAB2028A51AE42DE0EEB854A00B3EA5F79BA45CAB2EA4382D379EED3A780DD6C92383C1C39');
//
//        $res = $service->getInterestTagGroup();
//        dd($res);

//        $service = new DouYinWebSdk();
//        $secretKey = "AuISVb8*******PlyYEK3L2";
//        $akId = "AKTPZjAzMDR******NmNlMDE";
//        $sessionToken = "STS2eyJ*******ZCJ9";
//        $region = 'cn-north-1';
//        $serviceName = 'imagex';
//        $ldt = gmdate(self::ISO8601_BASIC);
//        $sdt = substr($ldt, 0, 8);
//
//        $str = $service->randomStr();
//        $param = [
//            "Action" => "ApplyImageUpload",
//            "ServiceId" => "jm8ajry58r",
//            "Version" => "2018-08-01",
//            "app_id" => "2906",
//            "s" => $str,
//            "user_id" => ""
//        ];
//
//        $queryString = $service->getQueryStr($param);
//
//
//        $date = date("Ymd", time());
//
//
////        $res = $service->getSigningKey($date, $region, $serviceName, $secretKey);
//        $res = $service->generateAuthorization($secretKey, $region, $serviceName, $queryString, $ldt, $sessionToken, $sdt, $akId);
//        dd($res);

//        $res = $service->sdkTest();

//        $service = new JosClient();
//        $param = [
//              'skuIds' => ['100034209075']
//        ];
//        $res = $service->requestV1('jd.union.open.goods.bigfield.query',$param);
//        dd($res);
//        $service = new JdSdk();
//        $res = $service->goodsDetail(["100034209075"]);
//        dd($res);

//        $service = new JosClient();
//        $param = [
//            'ids' => '100034209075',
//            'basefields' => 'name,imagePath'
//        ];
//        $res = $service->requestV2('jingdong.new.ware.baseproduct.get', $param);
//        dd($res);

//         $service = new JdWebSdk('thor=83CBDD78BD80069083AA3202302750B2E3F0D346630BF18238C5E17C255E19679A4D476A4B38931D6FA29C6E56F6B7FDCF2710F1FD020F6C4CFCEA1C44E595AD3D588B23089867D600EE83163EA0FCD345DF4F0C393634A247180422C3C722275B9D602E80FCD7FCD1ADF687DE9929CFF3B85AB6B643BA8B6ED66487B02CB327DC3CF7AD5DDD6BFD885CB1708CD80EA5D0043E6D8D882AA3A351B64D385C47ED');
//         $res = $service->syncStatus(449651605);
//         dd($res);

//          $service = new Top('610172990c65fa59367f8b2736e16c008554b1bef1848923087481805');
//          $dto = new ResourceCheckRequestDto();
//          $dto->resource_ids = [58468287013];
//          $dto->relation_id = "351f496d15b349cab9c9e513740fc706";
//
//          $res = $service->checkContent($dto);
//          dd($res->result->model->resource_statuses);

//        $res = UidService::taskVideoUid();
//        dd($res);

//        $service = new AigcSdk();
//        $res =  $service->chat();
//        dd($res);

//        $client = new Client();
//        $jsonData =  [
//            "path" => str_replace('\\','\\\\','K:\训练\测试'),
////            "path" => 'K:\\训练\\测试',
//            "interrogator_model" => "wd14-convnextv2-v2",
//            "threshold" => "0.35",
//            "additional_tags" => "",
//            "exclude_tags" => "",
//            "escape_tag" => true,
//            "batch_input_recursive" => false,
//            "batch_output_action_on_conflict" => "ignore",
//            "replace_underscore" => true,
//            "replace_underscore_excludes" => '0_0, (o)_(o), +_+, +_-, ._., <o>_<o>, <|>_<|>, =_=, >_<, 3_3, 6_9, >_o, @_@, ^_^, o_o, u_u, x_x, |_|, ||_||'
//        ];
//
//        $response = $client->request('post', 'http://fu.maixiaotu.com:28000/api/interrogate', [
//            'json' => $jsonData
//        ]);
//
//        $body = $response->getBody();
//        $res = json_decode($body, true);
//        dd($res);

//        $service = new ModelSdk();
//       $res =  $service->textToImage('xiaoqiaoqiao','在咖啡厅,坐着','512','512','cat','1');
//       dd($res);

        dd(file_exists('H:\maixiaotu\模型\打标'));
    }

}
